<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <div id="root" name="tom">
    你好
  </div>
</body>
<script type="module">
  const nextTick = Promise.resolve();
  console.log("同步代码1");
  nextTick.then(()=>{
    console.log("微任务2")
  });
  setTimeout(()=>{
    console.log("宏任务3")
  })
  console.log("同步代码4");
</script>
</html>

